/**
 * Author(s): xuming.Wong <xuming.Wong@gmail.com>
 */

#ifndef __M2_TEXTURE_LOADER_H__
#define __M2_TEXTURE_LOADER_H__

#include "OgreResource.h"

#include "M2File.h"
#include "M2ModelInfo.h"

namespace PQGame
{
	enum M2TexType
	{
		M2_TEX_TYPE_BLP_PATH,
		M2_TEX_TYPE_CHAR_BODY,
		M2_TEX_TYPE_CHAR_HAIR,
	};
	
	class M2TextureLoader 
		: public Ogre::ManualResourceLoader
	{
	public:
		M2TextureLoader(M2File* m2File,M2TexType type);
		~M2TextureLoader();

		void loadResource(Ogre::Resource* resource);
	private:
		void initCharBodyTex();
		void initCharHairTex();
	protected:
		M2File* _m2File;//tex file path
		Ogre::Texture* _texture;//compose by a list image
		M2ModelInfo* _modelInfo;
		M2TexType _texType;

	};

}

#endif
